	#include <plib.h>
	#include "Bike_Display_HW_Profile.h"
	#include <p32xxxx.h>


void IO_Startup_Config(void)
{

	// configure digital Outputs
	PORTSetPinsDigitalOut(IOPORT_G, OilTempLED1 | OilTempLED2 | OilTempLED3 | LightOnRelay);

	PORTSetPinsDigitalOut(IOPORT_E, BATLowLED | NeutralLED | LeftTurnLED | RightTurnLED | \
							HighBeamLED | CheckEngineLED | OilPressureLED | LowFuelLED);

	PORTSetPinsDigitalOut(IOPORT_D,	I2CLEDEnable | LCDReset);

	// Configure Digital Inputs
    PORTSetPinsDigitalIn(IOPORT_D, NeutralIn | LeftTurnIn | RightTurnIn | HighBeamIn | \
							CheckEngineIn | OilPressureIn | LowFuelIn); 
 
	// initialize the port pins states = output low
    PORTClearBits(IOPORT_G, OilTempLED1 | OilTempLED2 | OilTempLED3 | LightOnRelay);
    PORTClearBits(IOPORT_E, BATLowLED | NeutralLED | LeftTurnLED | RightTurnLED | \
							HighBeamLED | CheckEngineLED | OilPressureLED | LowFuelLED);
	// initialize the port pins states = output high
	PORTSetBits(IOPORT_D, I2CLEDEnable | LCDReset);
	
	

	// Configure Analog Inputs
	//PORTSetPinsAnalogIn(IOPORT_B, BatteryIn | OilTempIn);


	// configure the Change Notice Feature
	// Note: It is recommended to disable vectored interrupts prior to
    // configuring the change notice module, (if they are enabled).
    // The user must read one or more IOPORTs to clear any IO pin
    // change notice mismatch condition, then clear the change notice
    // interrupt flag before re-enabling the vector interrupts.   
}

/*void I2C_Startup_Config (void)
{
	// Configure Various I2C Options
	I2CConfigure(LED_DRIVER_I2C_BUS, I2C_ENABLE_SLAVE_CLOCK_STRETCHING);
	
	// Set Desired Operation Frequency
	actualClock = I2CSetFrequency(LED_DRIVER_I2C_BUS, GetPeripheralClock(), I2C_CLOCK_FREQ);
	if ( abs(actualClock-I2C_CLOCK_FREQ) > I2C_CLOCK_FREQ/10 )
	{
	    DBPRINTF("  Clock frequency (%d) error exceeds 10\%\r\n", actualClock);
	}
	else
	{
	    DBPRINTF("  Clock frequency = %ld Hz\n", actualClock);
	}
	
	//  Set the Slave Address
	I2CSetSlaveAddress(LED_DRIVER_I2C_BUS, MY_SLAVE_ADDRESS, 0, I2C_USE_7BIT_ADDRESS);
	DBPRINTF("  Slave address = 0x%02X\n", MY_SLAVE_ADDRESS);
	
	
	// Enable the module
	DBPRINTF("Enabling slave operations...\n");
	I2CEnable(I2C1A, TRUE);
}*/

